from django.db import models


# Create your models here.
from login_system.models import User


class Examination(models.Model):
    id = models.AutoField(primary_key=True)
    examination_time = models.DateTimeField()

    e_type = (
        (1, 'subject 1'),
        (2, 'subject 2'),
        (3, 'subject 3'),
        (4, 'subject 4')
    )

    examination_type = models.SmallIntegerField(choices=e_type)

    number_of_people = models.SmallIntegerField(default=100)
    time_out = models.BooleanField(default=False)


class ExaminationForPeople(models.Model):
    student = models.ForeignKey('login_system.User', on_delete=models.CASCADE)
    exaln = models.ForeignKey('Book_exaln_system.Examination', on_delete=models.CASCADE)
    score = models.FloatField(null=True)
    sbj_pass = models.BooleanField(default=False)
    reason_for_failure = models.CharField(max_length=255,default=None,null=True)
